package cn.xuziao.databasecourse.pojo;

import lombok.*;

/**
 * @author xuziao
 * @date 2021/11/6 20:59
 */

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class ComplexInfo {
    private int id;
    private String create_time;
    private String alter_time;
    private int info_type;
    private String pdf_path;
    private String image_path;
    private String name;
    private String author;
    private String description;

    public ComplexInfo(int info_type, String pdf_path, String image_path, String name, String author) {
        this.info_type = info_type;
        this.pdf_path = pdf_path;
        this.image_path = image_path;
        this.name = name;
        this.author = author;
    }

    public String[] getPaths() {
        return image_path.split("\\$");
    }

    //获取下载链接
    public String getDownloadPaths() {
        return this.pdf_path.replace("oss.xuziao.cn", "xza-bucket.oss-cn-beijing.aliyuncs.com");
    }


}
